﻿@using QLDV.Models
@model QLDV.Models.DOANVIEN
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout_NoMenu.cshtml";
}
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        var t = 1;
        $(".edited").live('click',function () {
            var tid = $(this).attr("id");
            tid = tid.substr(3);
            $("#" + tid).attr("style", "display:inline-block");
            $("#" + tid).focus();
            $(this).attr("style", "display:none");

        });

        $(".editing").live('focusout',function () {
            var tid = "ED_" + $(this).attr("id");
            $("#" + tid).attr("style", "display:inline-block");
            $(this).attr("style", "display:none");
        });

        $(".editing").live('change',function () {
            var tid = "ED_" + $(this).attr("id");
            $("#" + tid).text($(this).val());
        });
        $(".rowgd").live('mouseenter',function () {
            var tid = "Delgd" + $(this).attr("id");
            $("#" + tid).removeAttr("style");
        });
        $(".rowgd").live('mouseleave',function () {
            var tid = "Delgd" + $(this).attr("id");
            $("#" + tid).attr("style", "display:none");
        });
        $(".del").live('click',function () {
            var tid = $(this).attr("id").substr(5);
            $("#" + tid).remove();
        });
        $(".new").live('click',function () {
            t = t + 1;
            var html = "<tr  class='rowgd' id = 'Moi"+t+"'>";
            html += "<td>";
            html += "<span class='edited' id='ED_QuanHeMoi"+t+"' style='display: inline-block'>...</span>";
            html += "<input type='text' id='QuanHeMoi" + t + "' name='QuanHeMoi" + t + "' class='editing' value='...' style='display: none'/>";
            html += "</td>";
            html += "<td>";
            html += "<span class='edited' id='ED_HoTenMoi" + t + "' style='display: inline-block'>...</span>";
            html += "<input type='text' id='HoTenMoi" + t + "' name='HoTenMoi" + t + "' class='editing' value='...' style='display: none'/>";
            html += "</td>";
            html += "<td>";
            html += "<span class='edited' id='ED_NamSinhMoi" + t + "' style='display: inline-block'>...</span>";
            html += "<input type='text' id='NamSinhMoi" + t + "' name='NamSinhMoi" + t + "' class='editing' value='...' style='display: none'/>";
            html += "</td>";
            html += "<td>";
            html += "<span class='edited' id='ED_NgheNghiepMoi" + t + "' style='display: inline-block'>...</span>";
            html += "<input type='text' id='NgheNghiepMoi" + t + "' name='NgheNghiepMoi" + t + "' class='editing' value='...' style='display: none'/>";
            html += "</td>";
            html += "<td>";
            html += "<span class='edited' id='ED_NoiOMoi" + t + "' style='display: inline-block'>...</span>";
            html += "<input type='text' id='NoiOMoi" + t + "' name='NoiOMoi" + t + "' class='editing' value='...' style='display: none'/>";
            html += "</td>";
            html += "<td>";
            html += "<span class='edited' id='ED_SoDTMoi" + t + "' style='display: inline-block'>...</span>";
            html += "<input type='text' id='SoDTMoi" + t + "' name='SoDTMoi" + t + "' class='editing' value='...' style='display: none'/>";
            html += "</td>";
            html += "<td>";
            html += "<img src='../../media/delete.png' class='del' id='DelgdMoi"+t+"' width='13px;' style='display: none;'/>";
            html += "</td>";
            html += "</tr>"
            $("#tab_gd").append(html);
            $("#tab_gd").append($("#addnew"));
        });
    });
    $(function () {
        $(".date").datepicker({ dateFormat: "dd/mm/yy" });
    });
</script>
@using (Html.BeginForm("ViewInfo", "DoanVien", FormMethod.Post, new { id = "myform" }))
{
<div class="5grid">
    <div class="12u-first">
        <div class="2u-first">
            <img src="@Url.Content("../../media/" + "non_avatar.jpg")" height="90px"/>
        </div>
        <div class="4u">
            <h4 style="margin-top: 0px">MSSV: @Model.Id_Dv</h4>
            <div style="margin-bottom: 5px;">@ViewBag.csd.LOAICSD.Ten: @ViewBag.csd.Ten</div>
            <div style="margin-bottom: 5px;">@ViewBag.csd.CSD2.LOAICSD.Ten: @ViewBag.csd.CSD2.Ten</div>
        </div>
        <div class="6u">
            <a><span style="padding-right: 10px;">Tin tức</span></a>
            <a><span style="padding-right: 10px;">Hoạt động</span></a>
            <a><span style="padding-right: 10px;">Đoàn phí</span></a>
            <a><span style="padding-right: 10px;">Điểm rèn luyện</span></a>
            <a><span style="padding-right: 10px;">Lịch hoạt động</span></a>
        </div>
    </div>
    <div class="8u-first">
        <div class="sidebar_section">
            <div class="sidebar_title">
                <h4>Thông tin cơ bản</h4>
                <small>Các thông tin cơ bản của sinh viên</small>
            </div>


            <div style="height: 180px;">
            <div class="6u-first">
                <div class="row_edit">Họ tên đang dùng:</div>
                <div class="row_edit">Họ tên khai sinh:</div>
                <div class="row_edit">Ngày sinh:</div>
                <div class="row_edit">Dân tộc:</div>
                <div class="row_edit">Tôn giáo:</div>
                <div class="row_edit">Quê quán:</div>
            </div>
            <div class="6u">
                <div class="row_edit">
                    <div class = "edited" id = "ED_HoTenDangDung" style="display: inline-block">@Model.HoTenDangDung</div>
                    <input type="text" id = "HoTenDangDung" name = "HoTenDangDung" class = "editing" value="@Model.HoTenDangDung" style="display: none"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_HoTenKhaiSinh" style="display: inline-block">@Model.HoTenKhaiSinh</div>
                    <input type="text" id = "HoTenKhaiSinh" name = "HoTenKhaiSinh" class = "editing" value="@Model.HoTenKhaiSinh" style="display: none"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_NgaySinh" style="display: inline-block">@String.Format("{0:dd/MM/yyyy}",Model.NgaySinh)</div>
                    <input type="text" id = "NgaySinh" name = "NgaySinh" class = "editing date" value="@String.Format("{0:dd/MM/yyyy}",Model.NgaySinh)" style="display: none"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_DanToc" style="display: inline-block">@Model.DanToc</div>
                    <input type="text" id = "DanToc" name = "DanToc" class = "editing" value="@Model.DanToc" style="display: none"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_TonGiao" style="display: inline-block">@Model.TonGiao</div>
                    <input type="text" id = "TonGiao" name = "TonGiao" class = "editing" value="@Model.TonGiao" style="display: none"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_QueQuan" style="display: inline-block">@Model.QueQuan</div>
                    <input type="text" id = "QueQuan" name = "QueQuan" class = "editing" value="@Model.QueQuan" style="display: none"/>
                </div>
            </div>
            </div>
        </div>
        <div class="sidebar_section">
            <div class="sidebar_title">
                <h4>Quá trình công tác</h4>
                <small>Quá trình hoạt động của đoàn viên qua các giai đoạn</small>
            </div>
            <table cellpadding="5">
                <tr  style="text-align: left">
                    <th>Giai đoạn</th>
                    <th><span style="margin: 50px;"></span></th>
                    <th style="width: 100%">Chức vụ:</th>
                </tr>
            @foreach (QUATRINHCONGTAC q in ViewBag.qtct)
            {
                <tr>
                    <td>
                        @{string temp = "ED_NgayBatDau" + q.Id_Dv_Ct;}
                        <span class="edited" id="@temp" style="display: inline-block">@String.Format("{0:dd/MM/yyyy}", q.NgayBatDau)</span>
                        @{temp = "NgayBatDau" + q.Id_Dv_Ct;}
                        <input type="text" id="@temp" name="@temp" class="editing date" value="@String.Format("{0:dd/MM/yyyy}", q.NgayBatDau)" style="display: none"/>
                    <td>
                        @{temp = "ED_NgayKetThuc" + q.Id_Dv_Ct;}
                        <span class="edited" id="@temp" style="display: inline-block">@String.Format("{0:dd/MM/yyyy}", q.NgayKetThuc)</span>
                        @{temp = "NgayKetThuc" + q.Id_Dv_Ct;}
                        <input type="text" id="@temp" name="@temp" class="editing date" value="@String.Format("{0:dd/MM/yyyy}", q.NgayKetThuc)" style="display: none"/>
                    </td>
                    <td>
                        @{temp = "ED_ChucVu" + q.Id_Dv_Ct;}
                        <span class="edited" id="@temp" style="display: inline-block">@q.ChucVu</span>
                        @{temp = "ChucVu" + q.Id_Dv_Ct;}
                        <textarea type="text" id="@temp" name="@temp" class="editing"style="display: none">@q.ChucVu</textarea>
                    </td>
                </tr>
            }
            </table>
        </div>
        <div class="sidebar_section">
            <div class="sidebar_title">
                <h4>Nhận Xét</h4>
                <small>Nhận xét của các cơ sở Đoàn qua các năm hoạt động</small>
            </div>
             <table cellpadding="5">
                <tr  style="text-align: left">
                    <th>Giai đoạn</th>
                    <th><span style="margin: 50px;"></span></th>
                    <th>Nhận xét:</th>
                    <th>Cơ sở Đoàn</th>
                </tr>
            @foreach (NHANXET q in ViewBag.nxdv)
            {
                <tr>
                    <td>@String.Format("{0:dd/MM/yyyy}", q.NgayBatDau)</td>
                    <td>@String.Format("{0:dd/MM/yyyy}", q.NgayKetThuc)</td>
                    <td>@q.NhanXet1</td>
                    <td>@q.TenCoSoDoan</td>
                </tr>
            }
            </table>
        </div>
        <div class="sidebar_section">
            <div class="sidebar_title">
                <h4>Thông tin gia đình</h4>
                <small>Thông tin cá nhân của cha, mẹ và các thành viên trong gia đình</small>
            </div>
            <table id="tab_gd"cellpadding="4">
                <tr style="text-align: left">
                    <th style="width: 34px;">QH</th>
                    <th style="width: 133px;">Họ tên</th>
                    <th style="width: 40px;">NS</th>
                    <th style="width: 98px;">Nghề nghiệp</th>
                    <th style="width: 81px;">Nơi ở:</th>
                    <th style="width: 88px;">SĐT</th>
                    <th></th>
                </tr>
            @foreach (GIADINH q in ViewBag.gddv)
            {
                <tr class="rowgd" id="@q.Id_Dv_Gd">
                    <td>
                        @{string temp = "ED_QuanHe"+q.Id_Dv_Gd;}    
                        <span class="edited" id="@temp" style="display: inline-block">@q.QuanHe</span>
                        @{temp = "QuanHe" + q.Id_Dv_Gd;}
                        <input type="text" id="@temp" name="@temp" class="editing" value="@q.QuanHe" style="display: none"/>
                    </td>
                    <td>
                        @{temp = "ED_HoTen" + q.Id_Dv_Gd;}
                        <span class="edited" id="@temp" style="display: inline-block">@q.HoTen</span>
                        @{temp = "HoTen" + q.Id_Dv_Gd;}
                        <input type="text" id="@temp" name="@temp" class="editing" value="@q.HoTen" style="display: none"/>
                    </td>
                    <td>
                        @{temp = "ED_NamSinh" + q.Id_Dv_Gd;}
                        <span class="edited" id="@temp" style="display: inline-block">@q.NamSinh</span>
                        @{temp = "NamSinh" + q.Id_Dv_Gd;}
                        <input type="text" id="@temp" name="@temp" class="editing" value="@q.NamSinh" style="display: none"/>
                    </td>
                    <td>
                        @{temp = "ED_NgheNghiep" + q.Id_Dv_Gd;}
                        <span class="edited" id="@temp" style="display: inline-block">@q.NgheNghiep</span>
                        @{temp = "NgheNghiep" + q.Id_Dv_Gd;}
                        <input type="text" id="@temp" name="@temp" class="editing" value="@q.NgheNghiep" style="display: none"/>
                    </td>
                    <td>
                        @{temp = "ED_NoiO" + q.Id_Dv_Gd;}
                        <span class="edited" id="@temp" style="display: inline-block">@q.NoiO</span>
                        @{temp = "NoiO" + q.Id_Dv_Gd;}
                        <input type="text" id="@temp" name="@temp" class="editing" value="@q.NoiO" style="display: none"/>
                    </td>
                    <td>
                        @{temp = "ED_SoDT" + q.Id_Dv_Gd;}
                        <span class="edited" id="@temp" style="display: inline-block">@q.SoDT</span>
                        @{temp = "SoDT" + q.Id_Dv_Gd;}
                        <input type="text" id="@temp" name="@temp" class="editing" value="@q.SoDT" style="display: none"/>
                    </td> 
                    <td>
                        @{temp = "Delgd" + q.Id_Dv_Gd;}
                        <img src="../../media/delete.png" class="del" id="@temp" width="13px;" style="display: none;"/>
                    </td>
                </tr>
            }
            <tr id="addnew">
                <td>
                    <img src="../../media/new.png" class="new" width="10px;" />
                </td>
            </tr>
            </table>
        </div>
    </div>
    <div class="4u">
        <div class="sidebar_section">
            <div class="sidebar_title">
                <h4>Thông tin liên hệ</h4>
                <small>Địa chỉ mail, số điện thoại...</small>
            </div>
            <div style="height: 100px;">
            <div class="6u-first">
                <div class="row_edit">Số điện thoại:</div>
                <div class="row_edit">Địa chỉ email:</div>
                <div class="row_edit">Nơi ở hiện nay:</div>
            </div>
            <div class="6u">
                <div class="row_edit">
                    <div class = "edited" id = "ED_SDT" style="display: inline-block">@Model.SDT</div>
                    <input type="text" id = "SDT" name = "SDT" class = "editing" value="@Model.SDT" style="display: none"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_Email" style="display: inline-block">@Model.Email</div>
                    <input type="text" id = "Email" name = "Email" class = "editing" style="display: none" value = "@Model.Email"/>
                </div>
                <div class="row_edit">
                    <div class = "edited" id = "ED_NoiOHienNay" style="display: inline-block">@Model.NoiOHienNay</div>
                    <textarea type="text" id = "NoiOHienNay" name = "NoiOHienNay" class = "editing" style="display: none">@Model.NoiOHienNay</textarea>
                </div>
            </div>
            </div>
        </div>
        <div class="sidebar_section" style="border-bottom: 0">
            <div class="sidebar_title">
                <h4>Thông tin bổ sung</h4>
                <small>Các thông tin thêm về đoàn viên</small>
            </div>
            <div><strong>Nghề nghiệp:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_NgheNghiep" style="display: inline-block">@Model.NgheNghiep</div>       
                <input type="text" id = "NgheNghiep" name = "NgheNghiep" class = "editing" value="@Model.NgheNghiep" style="display: none"/>
            </div>
            <div><strong>Trình độ văn hóa:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_TDVanHoa" style="display: inline-block">@Model.TDVanHoa</div>       
                <input type="text" id = "TDVanHoa" name = "TDVanHoa" class = "editing" value="@Model.TDVanHoa" style="display: none"/>
            </div>
            <div><strong>Trình độ chuyên môn:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_TDChuyenMon" style="display: inline-block">@Model.TDChuyenMon</div>       
                <textarea type="text" id = "TDChuyenMon" name = "TDChuyenMon" class = "editing" style="display: none">@Model.TDChuyenMon</textarea>
            </div>
            <div><strong>Trình độ lý luận chính trị:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_TDLyLuanCT" style="display: inline-block">@Model.TDLyLuanCT</div>       
                <textarea type="text" id = "TDLyLuanCT" name = "TDLyLuanCT" class = "editing" style="display: none">@Model.TDLyLuanCT</textarea>
            </div>
            <div><strong>Ngoại ngữ:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_NgoaiNgu" style="display: inline-block">@Model.NgoaiNgu</div>       
                <textarea type="text" id = "NgoaiNgu" name = "NgoaiNgu" class = "editing" style="display: none">@Model.NgoaiNgu</textarea>
            </div>
            <div><strong>Tình hình sức khỏe:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_TinhHinhSucKhoe" style="display: inline-block">@Model.TinhHinhSucKhoe</div>       
                <textarea type="text" id = "TinhHinhSucKhoe" name = "TinhHinhSucKhoe" class = "editing" style="display: none">@Model.TinhHinhSucKhoe</textarea>
            </div>
            <div><strong>Khen thưởng:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_KhenThuong" style="display: inline-block">@Model.KhenThuong</div>       
                <textarea type="text" id = "KhenThuong" name = "KhenThuong" class = "editing" style="display: none">@Model.KhenThuong</textarea>
            </div>
            <div><strong>Kỷ luật:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_KyLuat" style="display: inline-block">@Model.KyLuat</div>       
                <textarea type="text" id = "KyLuat" name = "KyLuat" class = "editing" style="display: none">@Model.KyLuat</textarea>
            </div>
            <div><strong>Năng khiếu:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_NangKhieu" style="display: inline-block">@Model.NangKhieu</div>       
                <textarea type="text" id = "NangKhieu" name = "NangKhieu" class = "editing" style="display: none">@Model.NangKhieu</textarea>
            </div>
            <div><strong>Sở trường:</strong></div>
            <div style = "width: 100%; margin:10px;">
                <div class = "edited" id = "ED_SoTruong" style="display: inline-block">@Model.SoTruong</div>       
                <textarea type="text" id = "SoTruong" name = "SoTruong" class = "editing" style="display: none">@Model.SoTruong</textarea>
            </div>

        </div>
        
    </div>
    <div class="12u-first"><input type = "submit" value ="Lưu"/></div>
    
</div>
}
